package top.greatxiaozou.factorPattern;

public class FactorPattenDemo {
    public static void main(String[] args) {
        ShapeFactor shapeFactor = new ShapeFactor();

        //从工厂中获取对象
        Shape shape1 = shapeFactor.getShape("circle");
        Shape shape2 = shapeFactor.getShape("rectangel");
        Shape shape3 = shapeFactor.getShape("square");

        //使用对象
        shape1.draw();
        shape2.draw();
        shape3.draw();

    }
}
